{% extends "D3hdvHdvBundle::layoutadmin.html.twig" %}
{% block title %}
Hdv Admin - Ventes en cours Hdv {{ parent() }}
{% endblock %}


{% block body %}

{% if app.session.hasFlash('notice') %}
    <div class="flash-notice">
	<script>
        alert("{{ app.session.flash('notice') }}");
	</script>
    </div>
{% endif %}
		<div align="left">
<br />
<span class="monTitre">Ventes en cours</span>
<br /><br />
</div>
		<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table table-bordered">
			<thead>
				<tr>
				<th>Objets</th>
				<th>Nom</th>
				<th>Type de Paiement</th>
				<th>Prix</th>
				<th>Date de Debut</th>
				<th>Action</th>
				
				</tr>   
			</thead>
		{% if HdvVentes is defined %}	
				
			{% for HdvVente in HdvVentes %}
			<tr> 
				<td><img src="{{ asset('bundles/d3hdvdiablo3/images/uploads/objetsmodele/'~HdvVente.D3Objet.ObjetModele.image ) }}" alt="{{ HdvVente.D3Objet.ObjetModele.nom }}" class="img-polaroid" width=50px height=50px /></td>
				<td>{{ HdvVente.D3Objet.ObjetModele.nom }}</td>
				
				<td>
				{% if HdvVente.typePaiement == 0 %}
					En pièces d'or
				{% else %}
					En euros
				{% endif %}	
				</td>
				<td>
				{% if HdvVente.typePaiement == 0 %}
					{{ HdvVente.prix }} pièces d'or
				{% else %}
					{{ HdvVente.prix }} euros
				{% endif %}
				</td>			
				<td>{{ HdvVente.dateDebut|date("m/d/Y H:i:s") }}</td>		
				<td>
					<a href="{{ path('D3hdv_hdv_admin_annuler_vente', { 'idvente': HdvVente.id }) }}">Annuler la vente</a>
				</td>
				
			</tr> 	
					
				
			{% endfor %}
		</table> 
		{% else %}
			Pas d'objets mis en vente en ce moment !!
			
		{% endif %}



		{% if last_page > 1 %}

			<ol>
			  {% for page in 1..last_page %}
				  {% if page == current_page %}
				  	{{ page }}
				  {% else %}
				  	<a id="page" href="{{ path('D3hdv_hdv_admin_voir_ventes', { 'page': page }) }}">{{ page }}</a>
				  {% endif %}
			  {% endfor %}
			</ol>

		{% endif %}
		      <div class="pagination_desc"> <strong>{{ total_hdventes }}</strong> Objet(s) trouvé(s)
			 
		{% if last_page > 1 %}
			- page <strong>{{ current_page }}/{{ last_page }}</strong> {% endif %} </div>
		


{% endblock %}



